import request from "@/utils/request";

/**
 * 查看组别列表
 * @returns {*}
 */
export function getList(params) {
  return request({
    url: "/league/competitionProject/list",
    method: "get",
    params: params,
  });
}

/**
 * 新增
 * @returns {*}
 */
export function addList(data) {
  return request({
    url: "/league/competitionProject/addProjects",
    method: "post",
    data: data,
  });
}

/**
 * 加组别
 * @returns {*}
 */
export function addGroup(data) {
  return request({
    url: "/league/competitionGroup/addGroup",
    method: "post",
    data: data,
  });
}

/**
 * 加组别
 * @returns {*}
 */
export function getGroup(params) {
  return request({
    url: "/league/competitionGroup/list",
    method: "get",
    params: params,
  });
}

/**
 * 新增级别
 * @returns {*}
 */
export function addGroupChi(data) {
  return request({
    url: "/league/competitionLevel/addLevel",
    method: "post",
    data: data,
  });
}

/**
 * 查看批量导入
 * @returns {*}
 */
export function getImportApi(params) {
  return request({
    url: "/league/competitionProject/getBatchImportList",
    method: "get",
    params: params,
  });
}

/**
 * 批量导入
 * @returns {*}
 */
export function imputApi(data) {
  return request({
    url: "/league/competitionProject/batchImportProjects",
    method: "put",
    data: data,
  });
}

/**
 * 删除
 * @returns {*}
 */
export function delApi(data) {
  return request({
    url: "/league/competitionProject/" + data.ids,
    method: "delete",
    data: data,
  });
}

/**
 * 删除组
 * @returns {*}
 */
export function delGroupApi(data) {
  return request({
    url: "/league/competitionGroup/" + data.ids,
    method: "delete",
    data: data,
  });
}

/**
 * 删除级
 * @returns {*}
 */
export function delClass(data) {
  return request({
    url: "/league/competitionLevel/" + data.ids,
    method: "delete",
    data: data,
  });
}

/**
 * 查看项目详情
 * @returns {*}
 */
export function particularsApi(params) {
  return request({
    url: "/league/competitionProject/" + params.id,
    method: "get",
    params,
  });
}

/**
 * 修改项目
 * @returns {*}
 */
export function UpdateApi(data) {
  return request({
    url: "/league/competitionProject/updateProject",
    method: "put",
    data,
  });
}

/**
 * 修改组
 * @returns {*}
 */
export function UpdateGroupApi(data) {
  return request({
    url: "/league/competitionGroup/updateGroup",
    method: "put",
    data,
  });
}

/**
 * 修改级
 * @returns {*}
 */
export function UpdateClassApi(data) {
  return request({
    url: "/league/competitionLevel/updateLevel",
    method: "put",
    data,
  });
}

/**
 * 查看组详情
 * @returns {*}
 */
export function groupDetailsApi(params) {
  return request({
    url: "/league/competitionGroup/" + params.id,
    method: "get",
    params,
  });
}

/**
 * 查看级详情
 * @returns {*}
 */
export function classDetailsApi(params) {
  return request({
    url: "/league/competitionLevel/" + params.id,
    method: "get",
    params,
  });
}

/**
 * 子级别删除
 * @returns {*}
 */
export function delCompetitionSonLevel(data) {
  return request({
    url: "/league/competitionSonLevel/" + data.ids,
    method: "delete",
    data: data,
  });
}

/**
 * 子级别修改
 * @returns {*}
 */
export function updateSonLevel(data) {
  return request({
    url: "/league/competitionSonLevel/updateSonLevel",
    method: "put",
    data: data,
  });
}

/**
 * 新增子级别
 * @returns {*}
 */
export function addSonLevel(data) {
  return request({
    url: "/league/competitionSonLevel/addSonLevel",
    method: "post",
    data: data,
  });
}

/**
 * 批量添加组别
 * @returns {*}
 */
export function addGroups(data) {
  return request({
    url: "/league/competitionGroup/batch/addGroups",
    method: "post",
    data: data,
  });
}
